﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<DAL.Facility>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
     <script type="text/javascript">
        
    </script>

    <h2>Edit [<%=ViewData.Model.Name.ToString()%>]</h2>
    <% using (Html.BeginForm("Edit", "Facilities", FormMethod.Post, new { enctype = "multipart/form-data" , id="postform", name="postform" }))
        {%>
        <br />
        <div style="display:block">
            <%if (ViewData["Result"]!=null){ %>
                <%if (ViewData["Result"].ToString().Equals("Success"))
                  { %>
                    <div style="display:block; font-size:1.2em; font-weight:bold; color: Aqua;">
                        Successfully Saved!
                    </div>
                <%}
                  else
                  { %>
                    <div style="display:block; font-size:1.2em; font-weight:bold; color: Red;">
                        Failed!
                    </div>
                <%} %>
            <%} %>
        </div>
        <br />
    <div style="display:block;">
        <div style="width:130px; float:left;">Name </div>
        <div>:<%=Html.TextBoxFor(c=>c.Name) %>
        </div>
    </div>
    
    <div>
        <div style="width:130px; float:left;">Description</div>
         <div style="vertical-align:top;">:<%=Html.TextAreaFor(c => c.Description, new { style="width:600px;"})%>
        </div>
    </div>
    <div>
        <div style="width:130px; float:left;">UnderMaintenance</div>
         <div style="width:auto">:<%=Html.CheckBoxFor(c=>c.IsUnderMaintenance) %>
        </div>
      
    </div>
    <div>
        <div style="width:130px; float:left;">File</div>
         <div>:<%=Html.TextBoxFor(c => c.PicUrl)%><input type="file" id="fileUpload" name="fileUpload" size="23"/> 
        </div>             
    </div>
    <%if (Convert.ToString(ViewData.Model.SystemFileName) != string.Empty)
      { %>  
        <img src="<%=ViewData.Model.SystemFileName%>" />
    <%} %>                                       
    <div>
         <input type="submit" value="Save" />           
    </div>
     <% } %>    
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
